<?php

namespace App\Http\Controllers;

use App\Exports\UsersExport;
use App\Models\User;
use Maatwebsite\Excel\Facades\Excel;

class TestController extends Controller
{
	public function index()
	{
		$query = User::query()->where('id', '<', 10);
		return Excel::download(new UsersExport($query), 'users.xlsx');
	}
}
